package com.young.cloud.gateway.filter;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Administrator on 2019/12/28 0028.
 */
@Configuration
@ConditionalOnProperty(
        name = "young.cloud.gateway.sso.enable",
        havingValue = "true",
        matchIfMissing = true
)
@ConfigurationProperties(prefix="young.cloud.gateway.sso")
public class SsoConfiguration {
    /**
     * 是否开启单点验证
     */
    private boolean enable = true;
    /**
     * 单点验证白名单
     */
    private String[] ssoWhite = {};
    /**
     * 验证失败后重定向地址
     */
    private String ssoRedirectUrl;
    /**
     * 是否开启权限校验
     */
    private boolean authCheck = true;

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String[] getSsoWhite() {
        return ssoWhite;
    }

    public void setSsoWhite(String[] ssoWhite) {
        this.ssoWhite = ssoWhite;
    }

    public String getSsoRedirectUrl() {
        return ssoRedirectUrl;
    }

    public void setSsoRedirectUrl(String ssoRedirectUrl) {
        this.ssoRedirectUrl = ssoRedirectUrl;
    }

    public boolean isAuthCheck() {
        return authCheck;
    }

    public void setAuthCheck(boolean authCheck) {
        this.authCheck = authCheck;
    }
}
